package uk.ac.aber.paws.server.dataobjects;

import uk.ac.aber.paws.server.ownership.GenericComputerInfoQuery;

/**
 * @author Rob Johnson, Aberystwyth University
 * @email rob.johnson@aber.ac.uk
 * @date 21st May 2012
 * 
 * ComputerRecord.java
 * 
 * This stores information about the computer such as mac address and ip address for a given fqdn.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
public class ComputerRecord {

	/**
	 * Stores the fully qualified domain name
	 */
	private String COMPUTER_NAME = null;
	
	/**
	 * Stores the MAC address of the computer
	 */
	private String MAC_ADDRESS = null;
	
	/**
	 * Stores the IP address of the computer
	 */
	private String IP_ADDRESS = null;
	
	public ComputerRecord(String computerName) {
		
		COMPUTER_NAME = computerName;
		
		initObject();
	}
	
	private void initObject() {
		
		MAC_ADDRESS = (new GenericComputerInfoQuery(COMPUTER_NAME)).getMACAddress();
		IP_ADDRESS = (new GenericComputerInfoQuery(COMPUTER_NAME)).getIPAddress();
	}
	
	public String getMACAddress() {
		return MAC_ADDRESS;
	}
	
	public String getIPAddress() {
		return IP_ADDRESS;
	}
	
	public String getComputerName() {
		return COMPUTER_NAME;
	}
}
